<template>
  <div class="drag optional" :class="{ selected: index === selectedIndex }" @click.stop="$parent.$parent.onEditer(index)">
    <div class="diy-seckill" :style="'padding-top:'+item.style.paddingTop+'px;'">
      <div class="diy-active-item m-r-10">
      	<div class="active-item-top">
      		<div class="active-item-title">秒杀专区</div>
      		<div class="active-item-line">今日热抢</div>
      	</div>
      	<div class="active-item-mind">超值优惠 限时抢购</div>
      	<div class="active-item-product">
      		<div class="flex-column-center active-item-seckill" v-for="(product, index) in item.data" :key="index" v-if="index<2">
            <img class="active-item-product-image" v-img-url="product.image" />
      			<div class="active-item-product-price flex-center">￥120.00</div>
      		</div>
      	</div>
      </div>
      <div class="diy-active-item">
      	<div class="active-item-top">
      		<div class="active-item-title">拼团专区</div>
      		<div class="active-item-line">团购大放价</div>
      	</div>
      	<div class="active-item-mind">参与拼团 享受更低折扣</div>
      	<div class="active-item-product">
      		<div class="flex-column-center active-item-assemb" v-for="(aproduct, aindex) in item.data" :key="aindex" v-if="aindex<2">
            <img class="active-item-product-image" v-img-url="aproduct.image" />
            <div class="active-item-product-name u-line-1">
              <div class="sellMoney">75</div>
              <div class="sellMoney_small">.00</div>
              <div class="sellMoney_txt">成团价</div>
            </div>
      		</div>
      	</div>
      </div>
    </div>
    <div class="btn-edit-del">
      <div class="btn-del" @click.stop="$parent.$parent.onDeleleItem(index)">删除</div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        /*分类id*/
        category_id: 0
      };
    },
    created() {
      console.log(this.item.data)
    },
    props: ['item', 'index', 'selectedIndex'],
    methods: {
      /*计算宽度*/
      getUlwidth(item) {
        if (item.style.display == 'slide') {
          let total = 0;
          if (item.params.source == 'choice') {
            total = item.data.length;
          } else {
            total = item.defaultData.length;
          }
          let w = 0;
          if (item.style.column == 2) {
            w = total * 150;
          } else {
            w = total * 100;
          }
          return 'width:' + w + 'px;';
        }
      }
    }
  };
</script>

<style>
  .diy-seckill {
    background-color: rgba(250, 250, 250, 1);
    padding: 0 10px;
    /* border-radius: 10px; */
    width:100%;
    overflow: hidden;
  }

  .diy-seckill .diy-head {
    padding: 0 10px;
    height: 45px;
    background-size: 100% 100% !important;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
  }

  .diy-seckill .diy-head .name {
    font-size: 18px;
    font-weight: bold;
    width: 100px;
  }

  .diy-seckill .diy-head .datetime {
    margin-left: 20px;
  }

  .diy-seckill .diy-head .datetime>span {
    display: inline-block;
  }

  .diy-seckill .diy-head .datetime .text {
    padding: 0 4px;
  }

  .diy-seckill .diy-head .datetime .box {
    padding: 2px;
    border-radius: 4px;
    background: #000000;
    color: #ffffff;
  }

  .diy-seckill .product-list {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #F4DCD2 0%, #FFFFFF 100%);
    box-shadow: 0px 4px 2px 0px rgba(6, 0, 1, 0.03);
    padding:10px;
  }

  .diy-seckill .product-list .product-title {
    margin-top: 4px;
    height: 40px;
    line-height: 20px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .diy-seckill .display__list .column__3 {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .diy-seckill .product-list.column__3 .product-item {
    width: 66px;
    padding-bottom: 10px;
    margin-right: 23px;
  }
  .diy-seckill .product-list.column__3 .product-item:nth-child(3n) {
    margin-right: ;: 0;
  }
  .diy-seckill .product-list.column__3 .product-item .product-cover {
    width: 66px;
    height: 66px;
    border-radius: 6px;
    overflow: hidden;
  }

  .diy-seckill .product-list.column__3 .product-item .product-cover img {
    width: 66px;
    height: 66px;
  }

  .diy-seckill .product-list.column__3 .product-title {
    height: 20px;
    overflow: hidden;
  }

  .flex-space-between {
      flex-wrap: wrap;
  }

  .line-through{
  	text-decoration: line-through;
  }
  @font-face {
  	font-family: "YouSheBiao";
  	src:url('https://jiumiaoda.oss-cn-guangzhou.aliyuncs.com/wechat/font/YouSheBiaoTiHei-2.ttf')
  }
  .diy-seckill{
    display: flex;
    flex-direction: row;

  }

  .m-r-10{
    margin-right: 10px;
  }
	.diy-active-item {
  		border-radius: 8px;
  		width: 166px;
  		height: 127px;
      margin-bottom: 10px;
      background-color: #ffffff;
  }
  .diy-active-item .active-item-top{
  			display: flex;
  			flex-direction: row;
  			/* align-items: center; */
  			align-items: flex-start;
  }
  .active-item-top .active-item-title {
    padding: 6px 6px 6px 10px;
    font-size: 14px;
    color: #111111;
    font-weight: bold;
  }

  .active-item-top .active-item-line{
    margin-top: 7px;
    font-family: 'YouSheBiao';
    font-size: 10px;
    color: #ffffff;
    background-color: #d53124;
    padding:2px 7px;
    border-radius: 5px;
  }

  .active-item-top .active-item-img{
    margin-top: 7px;
    width: 18px;
    height: 18px;
    margin-left: 5px;
  }
  .diy-active-item .active-item-mind{
    font-size: 10px;
    color: #d53124;
    padding: 0 0 0 10px;
  }

  .diy-active-item .active-item-product {
    padding: 0 0 11px 0;
    display: flex;
    flex-direction: row;
  }
  .diy-active-item .active-item-product .active-item-seckill {
    /* flex: 1; */
    width: 49%;
    padding:2px 10px 10px 10px;
    position: relative;
    margin-bottom: 10px;
  }
  .active-item-seckill .active-item-product-image {
    /* width: 54px; */
    /* height: 54px; */
    width: 100%;
  }

  .active-item-seckill .active-item-product-price {
    position: absolute;
    bottom: 0;
    left: 5px;
    z-index: 1;
    margin-top: 10px;
    font-size: 12px;
    color: #ffffff;
    background-color: rgba(238, 20, 20, 0.7);
    border-radius: 8px;
    width: 70px;
    height: 24px;
    padding-left: 5px;
  }

  .diy-active-item .active-item-product .active-item-assemb {
    width: 49%;
  }
  .active-item-product .active-item-assemb .active-item-product-image {
    width: 54px;
    height: 54px;
  }

  .active-item-product .active-item-assemb .active-item-product-name {
    margin-top: 7px;
    color: #b12529;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
  .active-item-product .active-item-assemb .active-item-product-name::before{
    content: "￥";
    font-size: 9px;
  }

  .active-item-product .active-item-assemb .sellMoney {
    padding-top: 2px;
    font-size: 14px;
    font-weight: bold;
    color: #b12529;
    line-height: 11px;
  }
  .active-item-product .active-item-assemb .sellMoney_small {
    padding-top: 4px;
    font-size: 10px;
    font-weight: bold;
    color: #b12529;
    line-height: 11px;
  }
  .active-item-product .active-item-assemb .sellMoney_txt {
    margin-left: 5px;
    padding-top: 4px;
    font-size: 8px;
    color: #6b6b6b;
    line-height: 11px;
  }

  .active-item-product .active-item-assemb .active-item-product-name {
    font-size: 12px;
    color: #9E9E9E;
  }
</style>
